function showErrors() {
    var pathName = window.document.location.pathname;
    var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);
    //console.info(basePath);
    //var errImgSrc = projectName === 'HuzoERP' ? projectName + '/images/icons/error.png' : '/images/icons/error.png';
    var errImgSrc = '/images/icons/error.png';

    for (var i = 0; i < this.errorList.length; i++) {
        var error = this.errorList[i];
        this.settings.highlight && this.settings.highlight.call(this, error.element, this.settings.errorClass, this.settings.validClass);

        var elename = this.idOrName(error.element);

        // 错误信息
        var errdiv = $("#" + "errMsgFor" + elename);
        /*
         var errimg = $("#" + "errImgFor" + elename);
         if (errimg.length === 0) { // 没有img则创建   
         //errimg = $('<img id="' + "errImgFor" + elename + '" class="errMsgTooltip" style="display:inline-block;vertical-align: middle;"alt="错误" src=' + errImgSrc + '>');
         errimg = $('<i id="' + "errImgFor" + elename + '"class="fa-all fa-error fa-times-circle fa-1"></i>');
         errimg.attr({"for": this.idOrName(error.element), generated: true});
         errimg.insertAfter(error.element);
         }*/
        if (errdiv.length === 0) { // 没有div则创建   
            // 纯css不用图片的圆角div，存在在IE6下显示过长的问题   
            errdiv = $('<div id="' + "errMsgFor" + elename + '" class="tooltip classic" style="position:absolute;display:none;">'
                    + '<span class="errmsg"></span>'
                    + '</div> ');
            errdiv.attr({"for": this.idOrName(error.element), generated: true}).addClass(this.settings.errorClass);
            errdiv.css({left: $.getLeft(error.element) + 'px', top: $.getTop(error.element) + 'px'}); // 显示在控件的下面   
            errdiv.appendTo($('body'));
        }
        //errimg.show();
        errdiv.find(".errmsg").html(error.message || "");
        
        /*
        // 鼠标放到图片显示错误   
        $(errimg).hover(function (e) {
            var ediv = $("#" + "errMsgFor" + $(e.srcElement).prev().attr('id'));
            ediv.fadeIn(200);
        }, function (e) {
            var ediv = $("#" + "errMsgFor" + $(e.srcElement).prev().attr('id'));
            ediv.fadeOut(200);
        });*/

        // 鼠标放到控件上显示错误   
        $(error.element).hover(function (e) {
            var ediv = $("#" + "errMsgFor" + $(this).attr('id'));
            ediv.fadeIn(200);
        }, function () {
            var ediv = $("#" + "errMsgFor" + $(this).attr('id'));
            ediv.fadeOut(200);
        }
        );
    }

    // 校验成功的去掉错误提示   
    for (var i = 0; i < this.successList.length; i++) {
        var elename = this.idOrName(this.successList[i]);
        var errdiv = $("#" + "errMsgFor" + elename);
        //var errimg = $("#" + "errImgFor" + elename);
        errdiv.remove();
        //errimg.remove();
    }

    // 自定义高亮
    if (this.settings.unhighlight) {
        for (var i = 0, elements = this.validElements(); elements[i]; i++) {
            this.settings.unhighlight.call(this, elements[i], this.settings.errorClass, this.settings.validClass);
        }
    }
}

$.extend({
    getLeft: function (object) {
        var go = object;
        var oParent, oLeft = go.offsetLeft;
        while (go.offsetParent !== null) {
            oParent = go.offsetParent;
            oLeft += oParent.offsetLeft;
            go = oParent;
        }
        return oLeft;
    },
    getTop: function (object) {
        var go = object;
        var goHeight = go.height;
        var oParent, oTop = go.offsetTop;
        while (go.offsetParent !== null) {
            oParent = go.offsetParent;
            oTop += oParent.offsetTop;
            go = oParent;
        }
        return oTop + 22 + 10;// 之所以加22不加控件高度,为了兼容ie6.   
    }
});
// 本地语言   
jQuery.extend(jQuery.validator.messages, {
    required: "必填字段",
    remote: "请修正该字段",
    email: "请输入正确格式的电子邮件",
    url: "请输入合法的网址",
    date: "请输入合法的日期",
    dateISO: "请输入合法的日期 (ISO).",
    number: "请输入合法的数字",
    digits: "只能输入整数",
    creditcard: "请输入合法的信用卡号",
    equalTo: "请再次输入相同的值",
    accept: "请输入拥有合法后缀名的字符串",
    maxlength: jQuery.validator.format("请输入一个长度最多是 {0} 的字符串"),
    minlength: jQuery.validator.format("请输入一个长度最少是 {0} 的字符串"),
    rangelength: jQuery.validator.format("请输入一个长度介于 {0} 和 {1} 之间的字符串"),
    range: jQuery.validator.format("请输入一个介于 {0} 和 {1} 之间的值"),
    max: jQuery.validator.format("请输入一个最大为 {0} 的值"),
    min: jQuery.validator.format("请输入一个最小为 {0} 的值")
});